package com.dmp.common.mybatis;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public abstract class AbstractExtendService implements ExtendService {
	protected List<ExtendMethod> extendMethods = new ArrayList<ExtendMethod>();

	@Override
	public void extend(Map<String, Object> context) {
		for(ExtendMethod method : extendMethods){
			method.execute(context);
		}
	}

	@Override
	public void extend(List<Map<String, Object>> context) {
		for(ExtendMethod method : extendMethods){
			method.execute(context);
		}
	}
	
	public void setDay(String day){
		for(ExtendMethod method : extendMethods){
			method.setDay(day);
		}
	}
	
	public List<ExtendMethod> getExtendMethods() {
		return extendMethods;
	}

	public void setExtendMethods(List<ExtendMethod> extendMethods) {
		this.extendMethods = extendMethods;
	}
}
